#pragma once
#include<cmath>
#include<string>
#include "Texture.h"
using namespace std;

#define WIDTH 800 //Chieu rong man hinh
#define HEIGHT 600 //Chieu cao man hinh
#define BEGG 3 //So trung roi ra ngoai toi da
#define CSHIT 3 // So shit hung nham toi da
#define TIME 5000 //Thoi gian sinh san

int iScore =0;//Ghi nhan diem nguoi choi
int iLevel =0;//Muc do tro cho
int iBrokenEggs =0;//Ghi nhan so trung vo
int iShit =0;//Ghi nhan so shit hung nham
bool bGame =false;//Game la duoc phep hoat dong
bool bGameStart =false;//Game moi bat  dau
bool bGameOver =false;//Game da ket thuc
bool bPause =false;//Game duoc tam ngung
bool bHelp = false;//Hien thi help
float fX,fY;//Toa do diem hien tai cua ro hung 
float fSpeed =0.5;//Toc do trung roi


//Cau truc chuot
struct StructMouse
{
	float x, y;//Toa do diem x,y

	StructMouse() : x(0), y(0) {}
	//Khoi tao vi tri chuot
	void Init(int xx, int yy){
		this->x = xx - WIDTH / 2;
		this->y = -1 * (yy - HEIGHT / 2);
	}
	//Hien thi con tro chuot
	void display(){
		glColor3f(1, 1, 1);
		DrawTexture(x, y, SIGHT, Textures[SIGHT].width / 10, Textures[SIGHT].height / 10);
	}

} Mouse;
//Thiet lap mau
void glColor(float red, float green, float blue){
	glColor3f(red / 255, green / 255, blue / 255);
}
//Hien thi text len man hinh
void glText(float x, float y, char* st, int type = 8){
    glRasterPos3f(x,y,0);
    for (int i=0;i<(int)strlen(st);i++)
        glutBitmapCharacter((void*)type, st[i]);
}

void glText(float x, float y, float fst, int type = 8){
    char st[10];
    _itoa(static_cast <int> (fst), st, 10);
    glRasterPos3f(x,y,0);
    for (int i=0;i<(int)strlen(st);i++)
        glutBitmapCharacter((void*)type, st[i]);
}
//Chuyen so thanh chuoi
char* ToChar(float Value){
	char Temp[100];
	return _itoa(static_cast <int> (Value), Temp, 10);;
};
